﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;

namespace LilTmSim
{
	class StartStatePositionConverter : IMultiValueConverter
	{
		#region IMultiValueConverter Members

		public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (values[0] is Point && values[1] is Point && values[2] is Point)
			{
				Point start = (Point)values[0];
				Point middle = (Point)values[1];
				Point end = (Point)values[2];

				double x1 = start.X;
				double y1 = start.Y;

				//double x0 = middle.X;
				//double y0 = middle.Y;

				//double theta = Math.Atan2(y1 - y0, x1 - x0);
				//double sint = Math.Sin(theta);
				//double cost = Math.Cos(theta);

				//double headWidth = -25;
				//double headHeight = 0;

				//Point pt3 = new Point(
				//    x0 + (headWidth * cost - headHeight * sint),
				//    y0 + (headWidth * sint + headHeight * cost));

				//return pt3;
				return new Point(x1 + 25, y1);
			}

			return null;
		}

		public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}

	class EndStatePositionConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (value is Point)
			{
				Point p = (Point)value;
				Point rtn = new Point(p.X, p.Y + 125);
				return rtn;
			}

			return null;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}
